<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js运行顺序</title>
</head>
<body>
<script>
    var x=1;
    function foo(){
        x++;
        bar();
        console.log("x:",x);
    }
    function bar(){
        x++;
    }
    foo();
</script>
</body>
</html>